package com.ruanjian.eduservice.controller;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ruanjian.commonUtils.R;
import com.ruanjian.eduservice.entity.EduSubject;
import com.ruanjian.eduservice.entity.suject.OneSubject;
import com.ruanjian.eduservice.mapper.EduTeacherMapper;
import com.ruanjian.eduservice.service.EduSubjectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.web.multipart.MultipartFile;

import java.util.List;

/**
 * <p>
 * 课程科目 前端控制器
 * </p>
 *
 * @author testjava
 * @since 2021-12-07
 */
@RestController
@RequestMapping("/eduservice/subject")
@CrossOrigin
public class EduSubjectController {
    @Autowired
    private EduSubjectService eduSubjectService;

    //上传文件
    @PostMapping("/addSubject")
    public R addSubject(MultipartFile file)
    {
        eduSubjectService.saveSubject(file,eduSubjectService);
        return R.ok();
    }



    @GetMapping("getAllSubject")
    public R getAllSubject()
    {
        List<OneSubject> list=eduSubjectService.getAllOneTwoSubject();
        return  R.ok().data("list",list);

    }



}

